package com.lap.service.starter.api.builder;

import com.lap.service.starter.api.ApiResource;
import com.lap.tool.starter.holder.SpringHolder;
import java.util.List;
import lombok.experimental.UtilityClass;
import org.springframework.web.bind.annotation.RestController;

@UtilityClass
public class ApiScanner {
  public List<ApiResource> scan(String module, String name) {
    List<Object> sources = SpringHolder.getBeansWithAnnotation(RestController.class);
    return new ResourceDirector(new DefaultBuilder()).construct(module, name, sources);
  }
}
